import request from "@/utils/request";

export function reqGetUserList(page, limit, username) {
  return request({
    url: `/admin/acl/user/${page}/${limit}?username=${username}`,
    method: "get",
  });
}

export function reqAddOrUpdata(form) {
  if (form.id) {
    //修改
    return request({
      url: `/admin/acl/user/update`,
      method: "put",
      data: form,
    });
  } else {
    //添加
    return request({
      url: `/admin/acl/user/save`,
      method: "post",
      data: form,
    });
  }
}
export function reqDelete(id) {
  return request({
    url: `/admin/acl/user/remove/${id}`,
    method: "delete",
  });
}
export function reqAllDelete(Arr) {
  return request({
    url: `/admin/acl/user/batchRemove`,
    method: "post",
    data: Arr,
  });
}
export function reqJueseList(userId) {
  return request({
    url: `/admin/acl/user/toAssign/${userId}`,
    method: "get",
  });
}
export function reqEditRole(userId, roleId) {
  return request({
    url: `/admin/acl/user/doAssign?userId=${userId}&roleId=${roleId}`,
    method: "post",
  });
}
